package com.ihr360.expr.core;


import com.ihr360.expr.ExprDouble;
import com.ihr360.expr.ExprException;
import com.ihr360.expr.context.IEvaluationContext;

public abstract class DoubleInOutFunction extends AbstractFunction
{
    @Override
    public final Expr evaluate(IEvaluationContext context, Expr[] args)
            throws ExprException {
        assertArgCount(args, 1);
        return new ExprDouble(evaluate(asDouble(context, args[0], true)));
    }

    protected abstract double evaluate(double value) throws ExprException;
}
